package com.chahu.mapper;

import com.chahu.entity.Order;
import com.chahu.entity.Snack;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SearchMapper {

    @Select("select * from snacks where category_id = #{arg0} and name like concat('%', #{arg1}, '%')")
    List<Snack> search(Integer categoryId, String content);
    
    @Select("select * from snacks where name like concat('%', #{arg0}, '%')")
    List<Snack> searchByContent(String content);
    
    @Select("select * from orders where name like concat('%', #{arg0}, '%')")
    List<Order> searchOrderByContent(String content);
}
